<?php
use common\service\StaticService;
use backend\assets\AdminAsset;
use common\service\GlobalUrlService;

StaticService::includeAppJsStatic(GlobalUrlService::buildStaticUrl('/backend//admin/add-admin.js'),AdminAsset::class);
?>

<div class="layui-card">
    <div class="layui-card-header">添加管理员</div>
    <div class="layui-card-body">
        <form class="layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label">管理员名称</label>
                <div class="layui-inline">
                    <input type="text" class="layui-input" name="username">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">管理员邮箱</label>
                <div class="layui-inline">
                    <input type="email" class="layui-input" name="email">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">密码</label>
                <div class="layui-inline">
                    <input type="password" class="layui-input" name="password">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">角色</label>
                <?php foreach ($perms as $perm):?>
                    <div class="layui-inline">
                        <input type="checkbox" class="" name="role_ids[]" value="<?= $perm['group_id']?>" title="<?= $perm['group_name']?>">
                    </div>
                <?php endforeach;?>
            </div>
        </form>
        <div class="layui-form-item">
            <a class="layui-btn save-admin">确认</a>
            <a class="layui-btn layui-btn-primary" href="<?= GlobalUrlService::buildAdminUrl('admin/index')?>">取消</a>
        </div>
    </div>
</div>